<?php
namespace app\controller;
use app\BaseController;
use think\facade\Db;

class Service extends BaseController {
// 获取所有服务
public function index() {
$list = Db::table('service')->select();
return json(['code' => 200, 'data' => $list]);
}

// 根据类型查询服务
public function read($type) {
$data = Db::table('service')
->where('type', $type)
->select();
return json(['code' => 200, 'data' => $data]);
}
}